<template>
  <div class="app-container">
    <div
      style="display: flex; justify-content: space-between; align-items: center"
    >
      <h3>商品</h3>
      <el-button size="small" type="success" @click="handleAdd">
        <i class="el-icon-plus" />
        新增
      </el-button>
    </div>
    <!-- 自定义下划线，替代el-divider -->
    <div class="custom-divider" />
    <!-- 搜索区域使用 transform 包裹 -->
    <el-collapse-transition>
      <el-card v-show="isFilterVisible" class="search-wapper">
        <div>
          <el-form
            ref="searchForm"
            :model="listQuery"
            :inline="true"
            label-width="80px"
          >
            <el-form-item label="商品类型">
              <el-cascader
                v-model="listQuery.goodsTypeId"
                :options="goodsTypeOptions"
                :props="{
                  label: 'name',
                  value: 'id',
                  children: 'list',
                  checkStrictly: true,
                  emitPath: false,
                }"
                clearable
                placeholder="请选择商品类型"
                style="width: 200px"
                @change="handleFilter"
              ></el-cascader>
            </el-form-item>

            <el-form-item label="商品名称">
              <el-input
                v-model="listQuery.name"
                style="width: 200px"
                placeholder="请输入商品名称"
                clearable
              />
            </el-form-item>

            <el-form-item label="商品编号">
              <el-input
                v-model="listQuery.no"
                style="width: 200px"
                placeholder="请输入商品编号"
                clearable
              />
            </el-form-item>

            <el-form-item label="供应商">
              <el-select
                v-model="listQuery.supplierId"
                clearable
                placeholder="请选择供应商"
                style="width: 200px"
                @change="handleSupplierChange"
              >
                <el-option
                  v-for="item in supplierOptions"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>

            <el-form-item label="仓库">
              <el-select
                v-model="listQuery.warehouseId"
                clearable
                placeholder="请选择仓库"
                style="width: 200px"
                @change="handleWarehouseChange"
              >
                <el-option
                  v-for="item in warehouseOptions"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>

            <el-form-item>
              <el-button
                type="primary"
                style="margin-left: 10px"
                @click="handleFilter"
                >查询</el-button
              >
              <el-button style="margin-left: 10px" @click="resetQuery"
                >重置</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </el-card>
    </el-collapse-transition>

    <!-- 操作按钮区域 -->

    <!-- <el-card> -->
    <div class="table-operations">
      <el-form
        ref="searchForm"
        :model="listQuery"
        :inline="true"
        label-width="75px"
      >
        <el-form-item label="商品类型">
          <el-cascader
            v-model="listQuery.goodsTypeId"
            :options="goodsTypeOptions"
            :props="{
              label: 'name',
              value: 'id',
              children: 'list',
              checkStrictly: true,
              emitPath: false,
            }"
            clearable
            placeholder="请选择商品类型"
            style="width: 200px"
            @change="handleFilter"
          ></el-cascader>
        </el-form-item>

        <el-form-item label="商品名称">
          <el-input
            v-model="listQuery.name"
            style="width: 200px"
            placeholder="请输入商品名称"
            clearable
          />
        </el-form-item>

        <el-form-item label="商品编号">
          <el-input
            v-model="listQuery.no"
            style="width: 200px"
            placeholder="请输入商品编号"
            clearable
          />
        </el-form-item>

        <el-form-item label="供应商">
          <el-select
            v-model="listQuery.supplierId"
            clearable
            placeholder="请选择供应商"
            style="width: 200px"
            @change="handleSupplierChange"
          >
            <el-option
              v-for="item in supplierOptions"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="仓库">
          <el-select
            v-model="listQuery.warehouseId"
            clearable
            placeholder="请选择仓库"
            style="width: 200px"
            @change="handleWarehouseChange"
          >
            <el-option
              v-for="item in warehouseOptions"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button
            type="primary"
            style="margin-left: 10px"
            @click="handleFilter"
            >查询</el-button
          >
          <el-button style="margin-left: 10px" @click="resetQuery"
            >重置</el-button
          >
        </el-form-item>
      </el-form>
      <!-- <el-button
          type="primary"
          size="small"
          class="filter-trigger"
          @click="isFilterVisible = !isFilterVisible"
          >{{ isFilterVisible ? "收起" : "检索" }}
          <i
            :class="['el-icon-arrow-down', { 'is-reverse': isFilterVisible }]"
          ></i>
        </el-button> -->
      <!-- <el-button type="success" @click="handleAdd" size="small" icon="el-icon-plus"
          >新增</el-button
        > -->
      <!-- <el-button type="warning" @click="handleBatchEdit" size="small"
          >修改</el-button
        > -->
      <!-- <el-button type="danger" @click="handleDisable" size="small"
          >禁用</el-button
        >
        <el-button type="success" @click="handleEnable" size="small"
          >启用</el-button
        >
        <el-button type="primary" @click="handleImport" size="small"
          >导入</el-button
        >
        <el-button type="primary" @click="handleExport" size="small"
          >导出</el-button
        > -->
      <!-- <el-button @click="handleDelete" size="small">删除</el-button> -->
    </div>
    <!-- 表格区域 -->
    <el-table
      v-loading="listLoading"
      :data="goodsList"
      element-loading-text="加载中"
      border
      fit
      highlight-current-row
      stripe
      @selection-change="handleSelectionChange"
    >
      <!-- <el-table-column type="selection" width="55" align="center" /> -->

      <el-table-column label="序号" type="index" width="60" align="center" />

      <!-- <el-table-column label="图片" width="80" align="center">
          <template slot-scope="scope">
            <el-image
              v-if="scope.row.imageUrl"
              :src="scope.row.imageUrl"
              style="width: 50px; height: 50px"
              fit="contain"
              :preview-src-list="[scope.row.imageUrl]"
            ></el-image>
            <i
              v-else
              class="el-icon-picture-outline"
              style="font-size: 20px; color: #909399"
            ></i>
          </template>
        </el-table-column> -->

      <el-table-column
        label="商品编号"
        prop="no"
        min-width="80"
        align="center"
        sortable
      />

      <el-table-column
        label="商品名称"
        prop="name"
        align="left"
        show-overflow-tooltip
      />

      <!-- <el-table-column
          label="商品条码"
          prop="barCode"
          min-width="120"
          align="center"
          show-overflow-tooltip
        />

        <el-table-column label="商品标签" min-width="100" align="center">
          <template slot-scope="scope">
            <el-tag
              size="small"
              v-for="(tag, index) in scope.row.tags"
              :key="index"
              style="margin-right: 5px"
            >
              {{ tag }}
            </el-tag>
          </template>
        </el-table-column>

        <el-table-column
          label="辅助属性"
          prop="assistProperty"
          min-width="120"
          align="center"
          show-overflow-tooltip
        /> -->

      <el-table-column
        label="商品类别"
        prop="goodsTypeName"
        align="center"
        show-overflow-tooltip
      />

      <!-- <el-table-column
          label="规格型号"
          prop="unitName"
          min-width="200"
          align="center"
          show-overflow-tooltip
        /> -->

      <el-table-column
        label="供应商"
        prop="supplierName"
        align="center"
        show-overflow-tooltip
        width="120"
      />

      <el-table-column label="仓库" prop="warehouseName" align="center" />

      <el-table-column label="单位" prop="unitName" align="center" width="80"/>
      <el-table-column align="center" prop="price" label="价格" />
      <el-table-column align="center" prop="tax" label="税率" />
      <el-table-column align="center" prop="model" label="规格" width="120">
      </el-table-column>
      <el-table-column
        align="center"
        prop="createTime"
        label="创建时间"
        width="160"
      >
        <template slot-scope="scope">
          {{ scope.row.createTime | dateFormat }}
        </template>
      </el-table-column>
      <el-table-column label="操作" width="250" align="center">
        <template slot-scope="scope">
          <el-button type="primary" size="small" @click="handleEdit(scope.row)">
            <!-- <i class="el-icon-edit"></i> -->
            编辑
          </el-button>
          <!-- <el-button type="text" size="small" @click="handleView(scope.row)">
              <i class="el-icon-document"></i>
            </el-button> -->
          <el-button
            type="danger"
            size="small"
            @click="handleDelete(scope.row)"
          >
            <!-- <i class="el-icon-delete"></i> -->
            删除
          </el-button>
        </template>
      </el-table-column>
      <!-- <el-table-column
          label="首选仓库"
          prop="preferredWarehouse"
          min-width="120"
          align="center"
          show-overflow-tooltip
        />

        <el-table-column
          label="当前库存"
          prop="currentQty"
          min-width="100"
          align="center"
          sortable
        />

        <el-table-column
          label="期初数量"
          prop="initialQty"
          min-width="100"
          align="center"
          sortable
        />

        <el-table-column
          label="单位成本"
          prop="unitCost"
          min-width="100"
          align="center"
          sortable
        /> -->
    </el-table>
    <!-- 分页 -->
    <el-row :gutter="10" style="margin-top: 20px" type="flex" justify="end">
      <el-pagination
        background
        :current-page="listQuery.page"
        :page-sizes="[10, 20, 30, 40, 50]"
        :page-size="listQuery.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-row>
    <!-- </el-card> -->

    <!-- 新增/编辑弹窗 -->
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogFormVisible"
      width="60%"
    >
      <el-form
        ref="dataForm"
        :model="goodsForm"
        :rules="rules"
        label-width="100px"
      >
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="商品编号" prop="no">
              <el-input v-model="goodsForm.no" placeholder="请输入商品编号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="商品名称" prop="name">
              <el-input v-model="goodsForm.name" placeholder="请输入商品名称" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="商品类别" prop="goodsTypeId">
              <el-dropdown trigger="click" @command="handleGoodsTypeSelect">
                <el-input
                  v-model="goodsTypeInputName"
                  placeholder="请选择商品类型"
                  readonly
                  clearable
                  style="width: 200px"
                  suffix-icon="el-icon-arrow-down"
                  @clear="clearGoodsType"
                ></el-input>
                <el-dropdown-menu
                  slot="dropdown"
                  style="
                    max-height: 400px;
                    overflow-y: auto;
                    min-width: 250px;
                    padding: 0;
                  "
                >
                  <div style="padding: 10px">
                    <!-- 添加搜索输入框 -->
                    <el-input
                      v-model="goodsTypeFilterText"
                      placeholder="输入关键字进行过滤"
                      size="small"
                      prefix-icon="el-icon-search"
                      clearable
                      style="margin-bottom: 8px"
                    ></el-input>

                    <el-tree
                      ref="goodsTypeTree"
                      :data="goodsTypeOptions"
                      node-key="id"
                      :props="{
                        label: 'name',
                        children: 'list',
                      }"
                      :filter-node-method="filterGoodsTypeNode"
                      @node-click="handleGoodsTypeNodeClick"
                      highlight-current
                      default-expand-all
                    ></el-tree>
                  </div>
                </el-dropdown-menu>
              </el-dropdown>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="规格型号" prop="model">
              <el-input
                v-model="goodsForm.model"
                placeholder="请输入规格型号"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="价格" prop="price">
              <el-input-number
                v-model="goodsForm.price"
                :precision="2"
                :step="0.1"
                :min="0"
                style="width: 100%"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="税率" prop="tax">
              <el-input v-model="goodsForm.tax" placeholder="请输入税率">
                <template slot="append">%</template>
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="供应商" prop="supplierId">
              <el-select
                v-model="goodsForm.supplierId"
                placeholder="请选择供应商"
                style="width: 100%"
                clearable
              >
                <el-option
                  v-for="item in supplierOptions"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单位" prop="unitId">
              <el-select
                v-model="goodsForm.unitId"
                placeholder="请选择单位"
                style="width: 100%"
                clearable
              >
                <el-option
                  v-for="item in unitOptions"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="仓库" prop="warehouseId">
              <el-select
                v-model="goodsForm.warehouseId"
                placeholder="请选择仓库"
                style="width: 100%"
                clearable
              >
                <el-option
                  v-for="item in warehouseOptions"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <!-- 此列留空，保持对称性 -->
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  selGoodsListApi,
  addGoodsApi,
  updateGoodsByIdApi,
  delGoodsByIdApi,
  selDepartmentListApi,
  selGoodsTypeListApi,
} from "@/api/goods";

import {
  selSupplierListApi,
  selWarehouseListApi,
  selUnitListApi,
} from "@/api/system";

export default {
  name: "Goods",
  data() {
    return {
      list: [],
      total: 0,
      listLoading: false,
      // 查询参数
      listQuery: {
        goodsTypeId: null,
        name: "",
        page: 1,
        pageSize: 10,
        supplierId: null,
        warehouseId: null,
      },

      // 查询参数
      goodsTypeQuery: {
        name: "",
        page: 1,
        pageSize: 10,
        parentId: null,
      },
      customerTypeOptions: [
        { value: "", label: "全部" },
        { value: "华中地区", label: "华中地区" },
        { value: "华北地区", label: "华北地区" },
        { value: "华南地区", label: "华南地区" },
        { value: "广东省内", label: "广东省内" },
        { value: "批发", label: "批发" },
        { value: "零售", label: "零售" },
      ],
      multipleSelection: [],
      goodsList: [], // 商品列表
      // 是否显示搜索区域
      isFilterVisible: false,
      dialogFormVisible: false,
      dialogStatus: "create",

      // 表单数据 - 严格按照接口文档定义
      goodsForm: {
        goodsTypeId: "",
        name: "",
        no: "",
        model: "", // 添加规格型号字段
        price: 0,
        supplierId: "",
        tax: "",
        unitId: "",
        warehouseId: "",
      },
      // 供应商查询参数
      supplierQuery: {
        name: "",
        page: 1,
        pageSize: 10,
        supplierTypeId: "",
      },
      // 计量单位查询参数
      unitQuery: {
        name: "",
        page: 1,
        pageSize: 10,
      },
      // 供应商列表
      supplierList: [],
      // 仓库查询参数
      warehouseQuery: {
        name: "",
        page: 1,
        pageSize: 10,
      },
      // 仓库列表
      warehouseList: [],
      // 表单验证规则
      rules: {
        goodsTypeId: [
          { required: true, message: "请选择商品类别", trigger: "change" },
        ],
        name: [{ required: true, message: "请输入商品名称", trigger: "blur" }],
        no: [{ required: true, message: "请输入商品编号", trigger: "blur" }],
        price: [
          { required: true, message: "请输入价格", trigger: "blur" },
          { type: "number", message: "价格必须为数字", trigger: "blur" },
        ],
        supplierId: [
          { required: true, message: "请选择供应商", trigger: "change" },
        ],
        unitId: [{ required: true, message: "请选择单位", trigger: "change" }],
        warehouseId: [
          { required: true, message: "请选择仓库", trigger: "change" },
        ],
      },

      // 下拉选项数据
      goodsTypeOptions: [], // 商品类别选项
      supplierOptions: [], // 供应商选项
      unitOptions: [], // 单位选项
      warehouseOptions: [], // 仓库选项
      goodsTypePopoverVisible: false,
      goodsTypeTreeData: [], // 树形结构的商品类型数据
      goodsTypeInputName: "", // 显示选中的商品类型名称
      goodsTypeFilterText: "", // 新增：用于树节点过滤的关键字
    };
  },
  computed: {
    // 通过id判断是新增还是编辑
    dialogTitle() {
      // 判断 goodsForm 的 id 属性是否存在
      return this.goodsForm.id ? "编辑" : "新增";
    },

    goodsTypeTreeOptions() {
      // Convert flat list to hierarchical structure for cascader
      const buildTree = (items, parentId = null) => {
        return items
          .filter((item) => item.parentId === parentId)
          .map((item) => {
            const children = buildTree(items, item.id);
            if (children.length) {
              return { ...item, list: children };
            }
            return item;
          });
      };

      return buildTree([...this.goodsTypeOptions]);
    },
  },

  created() {
    // this.getList();
    this.selGoodsList();
    this.selSupplierList();
    this.selGoodsTypeList();
    this.selWarehouseList();
    this.selUnitList();
  },
  mounted() {
    // 在商品类型数据加载后初始化名称显示
    if (this.goodsTypeOptions.length > 0) {
      this.initGoodsTypeName();
    }
  },
  methods: {
    getList() {
      this.listLoading = true;

      // 模拟API调用获取数据
      setTimeout(() => {
        // 使用提供的真实数据
        const responseData = {
          status: 200,
          msg: "success",
          data: {
            total: 10,
            page: 1,
            records: 199,
            rows: [
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 1,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129352294951128",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "12032鼓风机",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH12032001",
                pinYin: "12032gfj",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129352294951128_0",
                unitCost: 0,
                unitId: "12911692439643",
                unitList: [],
                unitName: "个",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 2,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "1293167910943545",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "刀卡",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH058",
                pinYin: "dk",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "43.5*8*5刀",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "1293167910943545_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 3,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129338892941765",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "刀卡",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH057",
                pinYin: "dk",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "50*8*5刀",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129338892941765_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 4,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "1293167910943124",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "隔板",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH056",
                pinYin: "gb",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "500*440",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "1293167910943124_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 5,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129277496940434",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "纸箱",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH055",
                pinYin: "zx",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "510*450*265MM（正晧LOG）",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129277496940434_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 6,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129352294941533",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "油盖",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH054",
                pinYin: "yg",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "φ10.6*1.0黑色",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129352294941533_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 7,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129347398940457",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "标签",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH053",
                pinYin: "bq",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "防撕毁月份标签",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129347398940457_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 8,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "12936759940410",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "标签",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH052",
                pinYin: "bq",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "φ33  ZEJ(S)-7530H DC12V 0.60A UL CE",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "12936759940410_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 9,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129338892940343",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "含油轴承",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH051",
                pinYin: "hyzc",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "φ3*7*8（FAS022-019）",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129338892940343_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 10,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129352294940471",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "磁框",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH050",
                pinYin: "ck",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "φ30*13.0（总高）*2.0mm",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129352294940471_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 11,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "12936769940806",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "壳料",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH049",
                pinYin: "ql",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "7530S上壳带雨棚  螺孔4.5mm  环保PP",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "12936769940806_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 12,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129366191941503",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "壳料",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH048",
                pinYin: "ql",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "7530S含油下壳带牙齿  螺孔3.5mm  环保ABS+PC",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129366191941503_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 13,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129347398938957",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "壳料",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH047",
                pinYin: "ql",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "7530S含油鼓风叶 轴露12.3mm 环保PBT",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129347398938957_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 14,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "1293167910940429",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "电容",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH046",
                pinYin: "dr",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "2.2uf/50V    3*5",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "1293167910940429_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 15,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "12936749938463",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "IC",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH045",
                pinYin: "IC",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "CC6419（芯进）",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "12936749938463_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 16,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129347398938086",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "板子",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH044",
                pinYin: "bz",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "ZDYH-24-01 玻纤板",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129347398938086_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 17,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "12936749937970",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "矽钢片",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH043",
                pinYin: "xgp",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "Φ24*10*12片*0.5",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "12936749937970_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 18,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "12936769938818",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "铜线",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH042",
                pinYin: "tx",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "Φ0.19",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "12936769938818_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0.0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 19,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129352294936858",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "标签",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH041",
                pinYin: "bq",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0.0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "防撕毁月份标签",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129352294936858_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
              {
                advanceDays: 0,
                amount: 0,
                barCode: "",
                barcodeIsSernum: false,
                batch: "",
                batchFlags: "",
                brandId: 0,
                brandName: "",
                categoryName: "",
                common: false,
                contactNumber: "",
                createDate: "2025-03-21",
                currentQty: "0",
                customerForm: {},
                defaultPackUnit: "",
                defaultPackUnitId: 0,
                defaultSupplierId: 0,
                defaultSupplierName: "",
                delete: false,
                desc: "",
                discountRate: 0,
                entryId: 20,
                forbidNegInvSale: 1,
                fweight: 0,
                height: "0",
                highPurPrice: 0,
                id: "129358896936086",
                imageUrl: "",
                imgePicUrls: [],
                importAmount: "",
                importCodeType: 0,
                importPrice: "",
                importTaxAmount: "",
                importTaxPrice: "",
                invName: "",
                invNumber: "",
                invNumberMap: [],
                invShelfsMap: null,
                invSkus: [],
                isSerNum: 0,
                isWarranty: 0,
                josl: "",
                lastPurUnitId: 0,
                lastPurUnitName: "",
                lastSaleUnitId: "",
                lastSaleUnitName: "",
                length: "0",
                lengthUnit: 0,
                locationId: 0,
                locationName: "",
                locationNo: "",
                lowSalePrice: 0,
                name: "标签",
                nearPrice: 0,
                nearPurPrice: 0,
                nearTaxAmount: 0,
                nearTaxPrice: 0,
                nearTaxPurPrice: 0,
                number: "ZH040",
                pinYin: "bq",
                pluNumber: 0,
                prePrice1: 0,
                prePrice10: 0,
                prePrice2: 0,
                prePrice3: 0,
                prePrice4: 0,
                prePrice5: 0,
                prePrice6: 0,
                prePrice7: 0,
                prePrice8: 0,
                prePrice9: 0,
                price: 0,
                prices: [],
                proLicense: "",
                prodDate: "",
                producer: "",
                purPrice: 0,
                purUnitId: 0,
                purUnitName: "",
                qty: 0,
                quantity: 0,
                realQty: "0",
                registrationNo: "",
                remark: "",
                retailPrice: 0,
                safeDays: 0,
                saleCount: 0,
                salePrice: 0,
                salePrice1: 0,
                salePrice2: 0,
                salePrice3: 0,
                saleReturnCount: 0,
                saleUnitId: 0,
                saleUnitName: "",
                sernum: "",
                shelfStatus: 1,
                skuAssistId: "",
                skuBarCode: "",
                skuClassId: 0,
                skuId: 0,
                skuImageUrl: "",
                skuName: "",
                skuNumber: "",
                skuThumbnailPath: "",
                spec: "φ36 ZEJ(S)-9733H  DC12V  0.85A  UL CE",
                strategyType: "",
                taxPrice: 0,
                thumbnailPath: "",
                uniqueKey: "129358896936086_0",
                unitCost: 0,
                unitId: 0,
                unitList: [],
                unitName: "",
                unitTypeId: 0,
                unitTypeMapping: null,
                unitTypeName: "",
                validDate: "",
                volume: "0.000",
                weigh: false,
                weight: 0,
                width: "0",
                yxhtQtyDisplay: "",
              },
            ],
          },
        };

        this.list = responseData.data.rows;
        this.total = responseData.data.records;
        this.listLoading = false;
      }, 500);
    },

    // 获取商品类别列表
    async selGoodsTypeList() {
      const res = await selGoodsTypeListApi(this.goodsTypeQuery);
      this.goodsTypeOptions = res.records;
      // 如果有预设的商品类型ID，初始化显示名称
      this.initGoodsTypeName();
    },
    // 获取商品列表
    async selGoodsList() {
      const res = await selGoodsListApi(this.listQuery);
      this.goodsList = res.records;
      this.total = res.total;
    },
    // 获取供应商列表
    async selSupplierList() {
      const res = await selSupplierListApi(this.supplierQuery);
      this.supplierOptions = res.records;
    },
    // 获取仓库列表
    async selWarehouseList() {
      const res = await selWarehouseListApi(this.warehouseQuery);
      this.warehouseOptions = res.records;
    },
    // 获取计量单位列表
    async selUnitList() {
      const res = await selUnitListApi(this.unitQuery);
      this.unitOptions = res.records;
    },
    // 商品类型改变
    handleGoodsTypeChange(val) {
      console.log(val);
      this.selGoodsList();
    },
    // 供应商改变
    handleSupplierChange(val) {
      console.log(val);
      this.selGoodsList();
    },
    // 仓库改变
    handleWarehouseChange(val) {
      console.log(val);
      this.selGoodsList();
    },

    // 分页
    handleSizeChange(val) {
      this.listQuery.pageSize = val;
      this.selGoodsList();
    },
    // 分页
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.selGoodsList();
    },
    // 查询
    handleFilter() {
      this.listQuery.page = 1;
      this.selGoodsList();
    },
    // 重置
    resetQuery() {
      this.listQuery = {
        page: 1,
        pageSize: 10,
      };
      this.selGoodsList();
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 新增商品
    handleAdd() {
      this.goodsForm = {
        goodsTypeId: "",
        name: "",
        no: "",
        price: 0,
        supplierId: "",
        tax: "",
        unitId: "",
        warehouseId: "",
      };
      this.dialogFormVisible = true;
    },
    handleEdit(row) {
      this.goodsForm = {
        id: row.id, // 编辑时设置id
        goodsTypeId: row.goodsTypeId,
        name: row.name,
        no: row.no,
        price: row.price,
        supplierId: row.supplierId,
        tax: row.tax,
        unitId: row.unitId,
        warehouseId: row.warehouseId,
      };
      this.dialogFormVisible = true;
    },
    handleView(row) {
      // 处理查看
      this.$message({
        message: "查看客户: " + row.name,
        type: "info",
      });
    },
    // 删除
    handleDelete(row) {
      // 处理删除
      this.$confirm("此操作将永久删除该客户, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const res = await delGoodsByIdApi(row.id);
          if (res.code === 1) {
            this.$message.success("删除成功");
            this.selGoodsList();
          } else {
          }
        })
        .catch(() => {});
    },
    handleBatchEdit() {
      if (this.multipleSelection.length === 0) {
        this.$message({
          message: "请选择要修改的客户",
          type: "warning",
        });
        return;
      }
      this.$message({
        message: "批量修改选中的客户",
        type: "info",
      });
    },
    handleEnable() {
      // 处理启用
      this.$message({
        message: "启用客户",
        type: "info",
      });
    },
    handleDisable() {
      // 处理禁用
      this.$message({
        message: "禁用客户",
        type: "info",
      });
    },
    handleImport() {
      // 处理导入
      this.$message({
        message: "导入客户",
        type: "info",
      });
    },
    handleExport() {
      // 处理导出
      this.$message({
        message: "导出客户",
        type: "info",
      });
    },
    handleClose() {
      this.$confirm("确认关闭？")
        .then((_) => {
          this.dialogFormVisible = false;
        })
        .catch((_) => {});
    },
    // 提交表单
    submitForm() {
      this.$refs["dataForm"].validate(async (valid) => {
        if (valid) {
          try {
            const params = {
              goodsTypeId: this.goodsForm.goodsTypeId,
              name: this.goodsForm.name,
              no: this.goodsForm.no,
              model: this.goodsForm.model, // 添加规格型号字段
              price: this.goodsForm.price,
              supplierId: this.goodsForm.supplierId,
              tax: this.goodsForm.tax,
              unitId: this.goodsForm.unitId,
              warehouseId: this.goodsForm.warehouseId,
            };

            let res;
            if (this.goodsForm.id) {
              // 编辑：传入id
              res = await updateGoodsByIdApi({
                ...params,
                id: this.goodsForm.id,
              });
            } else {
              // 新增：不传id
              res = await addGoodsApi(params);
            }

            if (res.code === 1) {
              this.$message.success(
                `${this.goodsForm.id ? "编辑" : "新增"}成功`
              );
              this.dialogFormVisible = false;
              this.selGoodsList(); // 刷新列表
            } else {
              this.$message.error(res.message);
            }
          } catch (error) {
            console.error("操作失败:", error);
            this.$message.error("操作失败");
          }
        }
      });
    },
    handleGoodsTypeNodeClick(data) {
      console.log("选择商品类型:", data); // 调试用
      this.listQuery.goodsTypeId = data.id;
      this.goodsTypeInputName = data.name;
      this.handleFilter(); // 触发查询
    },
    clearGoodsType() {
      this.listQuery.goodsTypeId = null;
      this.goodsTypeInputName = "";
      this.handleFilter(); // 触发查询
    },

    // 格式化Tree数据结构 (已经基本符合要求，可能需要微调)
    formatTreeData(data) {
      return data.map((item) => {
        // 确保list属性存在并处理为children属性
        if (!item.list) {
          item.list = [];
        }
        return item;
      });
    },

    // 初始化时设置已选商品类型的显示名称
    initGoodsTypeName() {
      if (this.listQuery.goodsTypeId && this.goodsTypeOptions.length > 0) {
        // 递归查找商品类型名称
        const findTypeName = (data, id) => {
          for (const item of data) {
            if (item.id === this.listQuery.goodsTypeId) {
              return item.name;
            }
            if (item.list && item.list.length > 0) {
              const name = findTypeName(item.list, id);
              if (name) return name;
            }
          }
          return null;
        };

        const name = findTypeName(
          this.goodsTypeOptions,
          this.listQuery.goodsTypeId
        );
        if (name) {
          this.goodsTypeInputName = name;
        }
      }
    },
    filterGoodsTypeNode(value, data) {
      if (!value) return true;
      return data.name.toLowerCase().indexOf(value.toLowerCase()) !== -1;
    },
  },
  watch: {
    goodsTypeTreeData: {
      handler(val) {
        if (val && val.length > 0) {
          this.initGoodsTypeName();
        }
      },
      immediate: true,
    },
    // 监听筛选文本变化
    goodsTypeFilterText(val) {
      this.$refs.goodsTypeTree?.filter(val);
    },

    // 已有的其他监听...
    goodsTypeOptions: {
      handler(val) {
        if (val && val.length > 0) {
          this.initGoodsTypeName();
        }
      },
      immediate: true,
    },
  },
};
</script>

<style scoped lang="scss">
.filter-container {
  padding-bottom: 15px;
  margin-bottom: 15px;
}
.button-container {
  margin-bottom: 15px;
}
.search-wapper {
  margin-bottom: 15px;
}
.table-operations {
  margin-bottom: 15px;
}
/* 自定义下划线 */
.custom-divider {
  height: 1px;
  background-color: #ebeef5;
  margin: 13px 0;
}

.filter-trigger .el-icon-arrow-down {
  margin-left: 5px;
  transition: transform 0.3s;
}
.filter-trigger .el-icon-arrow-down.is-reverse {
  transform: rotate(180deg);
}
.dimension-separator {
  margin: 0 10px;
}
.dialog-footer {
  text-align: right;
}
</style>
